package com.csjy.migration.hnnd.workflow;

import com.csjy.migration.hnnd.DbUtil;
import com.csjy.migration.hnnd.ProgramArgument;
import com.csjy.migration.hnnd.annotation.Task;
import com.csjy.migration.hnnd.business.NdBpmFeeCollectionRecord;
import com.csjy.migration.hnnd.business.SourceBusinessData;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 次年收费审核
 */
public class ItemGetChargeHny extends WorkflowMigration {

    private NdBpmFeeCollectionRecord ndBpmFeeCollectionRecord = null;

    public ItemGetChargeHny(DbUtil sourceDbUtil, DbUtil targetDbUtil, SourceBusinessData sourceData, ProgramArgument programArgument, String projectId, String procInstId, Map procInstRow) throws Exception {
        super(sourceDbUtil, targetDbUtil, sourceData, programArgument, projectId, procInstId, procInstRow);
        this.customInitData();
    }

    @Override
    public void customInitData() throws Exception {
        this.curBizType = "cnsfsh";
        this.ndBpmFeeCollectionRecord = new NdBpmFeeCollectionRecord(sourceDbUtil,targetDbUtil,sourceData,programArgument,projectId,procInstId);
    }

    @Override
    public void customInsertOrUpdateData() throws Exception {
        this.ndBpmFeeCollectionRecord.start();
    }


    @Task("次年收费审核@项目经理提交资料")
    public void cnsfshxmjltjzl() throws Exception{
        this.curAffixType = "wthj";//委托函件

        this.curModelMap.put("all", new String[]{"task1535506358519xyb","下一步"});
        this.setCommonData(true,null);

        this.ndBpmFeeCollectionRecord.getTaskParamMap().put(this.curJbpmTaskInstanceId, this.initTaskParamMap());
    }

    @Task("次年收费审核@部门负责人审核")
    public void cnsfshbmfzrsh() throws Exception {
        this.curModelMap.put("同意",new String[] {"task1535506387199ty","同意"});
        this.curModelMap.put("不同意",new String[] {"endbty","不同意"});

        this.setCommonData(false,null);
    }

    @Task("次年收费审核@风控部经理审核")
    public void cnsfshfkbjlsh() throws Exception {
        this.curModelMap.put("同意",new String[] {"task1535506419510ty","同意"});
        this.curModelMap.put("不同意",new String[] {"endbty","同意"});

        this.setCommonData(false,null);
    }

    @Task("次年收费审核@财务部收费处理")
    public void cnsfshcwbsfcl() throws Exception{
        this.curModelMap.put("all",new String[] {"task1535506439540tg","通过"});
        this.setCommonData(false,null);
        this.ndBpmFeeCollectionRecord.getTaskParamMap().put(this.curJbpmTaskInstanceId, this.initTaskParamMap());
    }

    @Task("次年收费审核@财务部经理审核")
    public void cnsfshcwbjlsh() throws Exception {
        this.curModelMap.put("通过",new String[] {"endtg","通过"});
        this.curModelMap.put("退回",new String[] {"驳回","驳回"});
        this.setCommonData(false,null);
    }

    @Task("次年收费审核@业务副总审核")
    public void cnsfshywfzsh() throws Exception {
        this.cnsfshcwbjlsh();
    }

    @Task("次年收费审核@总经理审核")
    public void cnsfshzjlsh() throws Exception {
        this.curModelMap.put("all",new String[] {"endtg","通过"});
        this.setCommonData(false,null);
    }



}
